package com.greenline.pay.web.common.json;

public class BaseJson {

    public BaseJson() {
    }

    public BaseJson(Boolean hasError, String code, String message) {
        super();
        this.hasError = hasError;
        this.code = code;
        this.message = message;
    }

    public BaseJson(Boolean hasError, String message) {
        this.hasError = hasError;
        this.message = message;
    }

    public BaseJson(String errroMessage) {
        this.hasError = Boolean.TRUE;
        this.message = errroMessage;
    }

    /**
     * 是否有错
     */
    private Boolean hasError = false;
    /**
     * code=500时表示当前请求的操作出错了 需要转到当前操作失败页0表示成功
     */
    private String code = "0";

    /**
     * 有错为错误信息，没错为成功提示信息
     */
    private String message;

    public Boolean getHasError() {
        return hasError;
    }

    public void setHasError(Boolean hasError) {
        this.hasError = hasError;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public void setErrorMessage(String errorMessage) {
        this.message = errorMessage;
        this.hasError = Boolean.TRUE;
    }
    
    public void setErrorMessage(String errorMessage,String code) {
        this.message = errorMessage;
        this.hasError = Boolean.TRUE;
        this.code = code;
    }
}
